package org.csu.mypetstorecmsapi.persistence;

import org.csu.mypetstorecmsapi.domain.Product;
import org.csu.mypetstorecmsapi.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao extends JpaRepository<User, Integer>
{
    @Modifying
    @Query(value = "select * from account where userid =?1", nativeQuery = true)
    List<User> findByUsername(String username);
}
